Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stianlarsen/react-ui-kit

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stianlarsen/react-ui-kit

A versatile React UI kit focused on delivering ready-to-use, customizable buttons for every use case. Designed to save developers time and streamline UI development, this kit offers a range of button styles and loaders, ensuring immediate integration and

  • 1.1.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

React UI Kit

A versatile React UI kit focused on delivering ready-to-use, customizable buttons for every use case. Designed to save developers time and streamline UI development, this kit offers a range of button styles and loaders, ensuring immediate integration and thematic coherence across projects.

Check out the website for demo's, examples, and further info.

Features

  • Customizable Button Components: Easily adaptable button components for various use cases including primary, secondary, destructive, and loading states.
  • Loader Component: A sleek loader component for indicating processing or loading states, perfectly matching the button aesthetics.
  • Ease of Use: Designed for developers who need quick, reliable UI components without the hassle of creating them from scratch.
  • Thematic Consistency: All components are designed with a cohesive look and feel, making it easy to maintain visual consistency throughout your application.

Installation

Install the package using npm:

npm install @stianlarsen/react-ui-kit

Or using yarn:

yarn add @stianlarsen/react-ui-kit

Usage

Button

Import and use the Button component in your React project:

import { Button } from "@stianlarsen/react-ui-kit";

function App() {
  return <Button variant="primary">Click Me</Button>;
}

Loader

Import and use the Loader component to indicate loading state:

import { Loader } from "@stianlarsen/react-ui-kit";

function App() {
  return <Loader />;
}

Default CSS Variables

Add the variables below to your global.css ( or equivalent stylesheet ) ro customize the colors and themes.

/* == light mode == **/
:root {
  --button-radius: 0.5rem;
  --button-border: 240 5.9% 90%;
  --button-padding: 0.75rem 1.25rem;
  --button-line-height: 1;

  --button-background: 0 0% 100%;
  --button-foreground: 240 10% 3.9%;

  --button-primary: 263.4 70% 50.4%;
  --button-primary-foreground: 210 20% 98%;

  --button-default: 240 5.9% 10%;
  --button-default-foreground: 0 0% 98%;

  --button-destructive: 0 72.22% 50.59%;
  --button-destructive-foreground: 0 0% 98%;

  --button-secondary: 240 4.8% 95.9%;
  --button-secondary-foreground: 240 5.9% 10%;

  --button-accent: 240 4.8% 95.9%;
  --button-accent-foreground: 240 5.9% 10%;
}

/* == dark mode == */
@media (prefers-color-scheme: dark) {
  :root {
    --button-radius: 0.5rem;
    --button-border: 240 3.7% 15.9%;

    --button-background: 240 10% 3.9%;
    --button-foreground: 0 0% 98%;

    --button-primary: 263.4 70% 50.4%;
    --button-primary-foreground: 210 20% 98%;

    --button-default: 0 0% 98%;
    --button-default-foreground: 240 5.9% 10%;

    --button-destructive: 0 62.8% 30.6%;
    --button-destructive-foreground: 0 85.7% 97.3%;

    --button-secondary: 240 3.7% 15.9%;
    --button-secondary-foreground: 0 0% 98%;

    --button-accent: 240 3.7% 15.9%;
    --button-accent-foreground: 0 0% 98%;
  }
}

Customizing Styles with CSS Variables

Our components use HSL color values for easy customization of themes. When overriding the CSS variables for colors, please provide values in HSL format to ensure compatibility.

Example of customizing the primary button color in HSL:

How to Customize

To customize these styles, simply redefine the CSS variables in your project's global.css or equivalent stylesheet:

:root {
  --button-primary: 25 100% 50%;
}

Our button uses these values ( variables ) like this

.button-primary {
  background-color: hsl(var(--button-primary));
}

By leveraging CSS variables, the React UI Kit ensures you can easily theme your components to fit the look and feel of your application, all while maintaining the ease of use and flexibility that comes with CSS customization.

Applying the Variables

The button component is already using the variables mentioned above, so you only need to change the hsl values to your liking.

Contributing

Contributions are always welcome! Please contact me for further info.

License

@stianlarsen/react-ui-kit is MIT licensed.

Contact

For any questions or suggestions, feel free to reach out.

Keywords

FAQs

Package last updated on 18 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc